package com.success.hrm.feignclients;


import com.success.hrm.fallback.FastdfsFeignClientFallbackFactory;
import com.success.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

//value属性：调用目标服务的服务名
@FeignClient(value="Fastdfs-server", fallbackFactory = FastdfsFeignClientFallbackFactory.class)
public interface FastdfsFeignClient {

    //目标服务的controller的方法，拷贝过来，修改
    //设置值
    @PostMapping("/Fastdfs/set")
    AjaxResult set(@RequestParam("key") String key, @RequestParam("value") String value);

    //获取值
    @GetMapping("/Fastdfs/get/{key}")
    AjaxResult get(@PathVariable("key") String key);

}
